/*
** my_strstr.c for my_strstr in /home/chassa_m/rendu/Piscine-C-Jour_06/ex_04
** 
** Made by chassa_m
** Login   <chassa_m@epitech.net>
** 
** Started on  Tue Oct  8 09:17:06 2013 chassa_m
** Last update Wed Oct  9 14:50:01 2013 chassa_m
*/

char	*my_strstr(char *str, char *to_find)
{
  int	i_meter;
  int	i_count;

  i_meter = 0;
  i_count = 0;
  while (str[i_meter])
    {
      if (str[i_meter] == to_find[i_count])
	{
	  i_count = i_count + 1;
	}
      else
	{
	  i_count = 0;
	}
      if (!to_find[i_count])
	{
	  i_meter = i_meter - (i_count - 1);
	  return (str + i_meter);
	}
      i_meter = i_meter + 1;
    }
  return (0);
}
